// 说说相关类型定义

/**
 * 说说数据类型
 */
export interface TalkItem {
  id: number;
  userId: number;
  content: string;
  images?: string;
  likeCount: number;
  commentCount: number;
  createTime: string;
  updateTime: string;
  isDelete: number;
  // 关联用户信息
  username?: string;
  avatar?: string;
  // 点赞状态
  isLiked?: boolean;
  // 图片列表
  imageList?: string[];
}

/**
 * 说说列表响应类型
 */
export interface TalkListResponse {
  list: TalkItem[];
  total: number;
  size: number;
  page: number;
  totalPages: number;
}

/**
 * 评论数据类型
 */
export interface CommentItem {
  id: number;
  userId: number;
  talkId: number;
  content: string;
  parentId: number;
  replyCount: number;
  createTime: string;
  updateTime: string;
  isDelete: number;
  // 关联用户信息
  username?: string;
  avatar?: string;
  // 回复层级信息
  level?: number;
  isSecondLevelReply?: boolean;
  replyToUsername?: string;
  // 嵌套回复（与后端children字段对应）
  children?: CommentItem[];
  replies?: CommentItem[];  // 兼容旧代码
}

/**
 * 点赞数据类型
 */
export interface LikeItem {
  id: number;
  userId: number;
  talkId: number;
  createTime: string;
  isDelete: number;
}

/**
 * 发布说说参数类型
 */
export interface PublishTalkParams {
  content: string;
  images?: string;
}

/**
 * 评论参数类型
 */
export interface CommentParams {
  talkId: number;
  content: string;
  parentId?: number;
  userId: number;
}

/**
 * 分页参数类型
 */
export interface PaginationParams {
  page?: number;
  size?: number;
}